#include "tree.h"

TreeNode* insertNode(TreeNode* root, int value) {
  if (root == nullptr) {
    return new TreeNode(value);
  }

  if (value < root->val) {
    root->left = insertNode(root->left, value);
  } else if (value > root->val) {
    root->right = insertNode(root->right, value);
  }

  return root;
}